﻿using Inovout.Data.Domain;
using KuaJing.Commodity.Domain;
using KuaJing.Customs.Domain;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace KuaJing.Orders.Domain
{
    partial class Order : DataObject
    {
        public Order()
        {
            this.Items = new DataObjectSet<OrderItem>();
            this.Declarations = new DataObjectSet<Declaration>();
        }
        [DataProperty("订单编号", DataType.Text,null, true, null, null)]
        public virtual string Code { get; set; }
        /// <summary>
        /// 江苏跨境还是南京贸互通
        /// </summary>
        [DataProperty("经营单位", DataType.Text, null, true, null, null)]
        public virtual string Provider { get; set; }
        /// <summary>
        /// 委托方，渠道不是客户，也不是委托方
        /// </summary>
        [DataProperty("委托客户", DataType.Text, null, true, null, null)]
        public virtual string CustomerName { get; set; }
        [DataProperty("下单日期", DataType.Date, "{0:yyyy-M-d h:m}", false, null, null)]
        public virtual DateTime? OrderTime { get; set; }

        [DataProperty("报关币种", DataType.Text, null, true, null, null)]
        public virtual string DeclarationCurrency { get; set; }
        [DataProperty("报关单号", DataType.Text, null, true, null, null)]
        public virtual string DeclarationCode { get; set; }
        [DataProperty("报关金额", DataType.Text,"{0:N}", true, null, null)]
        public virtual decimal DeclarationAmount { get; set; }
        [DataProperty("记账汇率", DataType.Text, null, true, null, null)]
        public virtual decimal? AccountExchangeRate { get; set; }

        [DataProperty("订单CNY金额", DataType.Currency, "{0:N}", true, null, null)]
        public virtual decimal TradeAmount { get; set; }
        [DataProperty("出口日期", DataType.Date, "{0:yyyy-M-d}", false, null, null)]
        public virtual DateTime? ExportDate { get; set; }
        [DisplayName("状态"), UIHint("Enum"), Required]
        public virtual OrderStatus Status { get; set; }
        [DataProperty("上报日期", DataType.Date, "{0:yyyy-M-d}", false, null, null)]
        public virtual DateTime? ReportDate { get; set; }

        public virtual ISet<OrderItem> Items { get; set; }
        public virtual ISet<Declaration> Declarations { get; set; }

        public virtual Customer Customer { get; set; }
        public virtual ExportContract ExportContract { get; set; }
    }
}
